From 7a481bfa4f6a623e87a4bac3b50a5ef5924d9f2c Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 13 Apr 2017 17:35:02 +0200 Subject: [PATCH] x86/vIO-APIC: fix uninitialized variable warning In a release build modern gcc validly complains about "pin" possibly being uninitialized in vioapic_irq_positive_edge(). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper Release-acked-by: Julien Grall --- xen/arch/x86/hvm/vioapic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index 52555cd328..5157db7a4e 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm/vioapic.c @@ -421,7 +421,11 @@ void vioapic_irq_positive_edge(struct domain *d, unsigned int irq) struct hvm_vioapic *vioapic = gsi_vioapic(d, irq, &pin); union vioapic_redir_entry *ent; - ASSERT(vioapic); + if ( !vioapic ) + { + ASSERT_UNREACHABLE(); + return; + } HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "irq %x", irq); -- 2.30.2